import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/Home.vue'
import MainView from '../views/Main.vue'
import sendView from '../views/Send.vue'
import reveiveView from '../views/Receive.vue'
// 可以使用动态的方法配置路由
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/webrtc',
      name: 'webrtc',
      component: () => import('../views/webrtc/Index.vue')
    },
    {
      path: '/owt',
      name: 'owt',
      component: () => import('../views/owt/Index.vue')
    },
    {
      path: '/peer',
      name: 'peer',
      component: () => import('../views/peer/Index.vue')
    },
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/send',
      name: 'send',
      component: sendView
    },
    {
      path: '/receive',
      name: 'receive',
      component: reveiveView
    },
    {
      path: '/main',
      name: 'main',
      component: MainView
    },
    {
      path: '/:catchAll(.*)',
      name: 'error',
      component: () => import('../views/Error.vue')
    }
  ]
})

export default router
